package com.pubinfo.passbook.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pubinfo.passbook.common.entity.TFileElectronicFtp;
import com.pubinfo.passbook.common.entity.TSourceArtificial;
import com.pubinfo.passbook.common.model.dto.MDM.TSourceArtificialParam;
import com.pubinfo.passbook.common.model.vo.rule.TSourceArtificialDetailVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xuhong
 * @since 2021-11-23
 */
@Mapper

public interface TSourceArtificialMapper extends BaseMapper<TSourceArtificial> {

  Boolean updateSystemIsLocked(String id);

  IPage<TSourceArtificialDetailVo> listArtificial(IPage<TSourceArtificialDetailVo> page, @Param("param") TSourceArtificialParam param);
  
  Boolean insertArtificialWiteoff(@Param("systemId") String witeoffId, @Param("artificialIds") List<String> artificialIds);

  Boolean updateArtificialWiteoffSum(String id);

  Boolean updateAgainArtificialWiteoffSum(@Param("id")String id,@Param("oldId")String oldId);

  BigDecimal findStartLineByNsrsbh(@Param("nsrsbh") String nsrsbh);
  
  /*
  查询能自动报账的手工票据
   */
  List<TSourceArtificial> findAutoArtificialReimbursement(@Param("ids") List<String> ids);
  
  Boolean updateByWiteoffId(@Param("witeoffId") String witeoffId);
  
  List<TSourceArtificial> listArtificialByWiteoffId(@Param("witeoffIds") List<String> witeoffIds);
  
  List<TFileElectronicFtp> findFileFtpByArtificiaIds(@Param("ids") List<String> ids);

  Boolean deleteByArtificialId(String id);

  List<TSourceArtificial> selectArtificialByOtherSystemMainId(String otherSystemMainId);

  Boolean updateArtificialSumById(@Param("tSourceArtificial")TSourceArtificial tSourceArtificial,@Param("witeoffId")String witeoffId);

  Boolean deleteArtificialWiteoff(String systemId);
}